<template>
	<Modal v-model="modal" title="订单详情">
		<Form ref="formValidate" :label-width="100">
			<Form-item label="订单状态:">
			{{['待审核', '平台审核通过', '平台审核未通过','卖家审核通过','卖家审核未通过','确认发货','确认收货','退货中','退货成功','取消'][orderInfo.orderType]}}
			</Form-item>
			<Form-item label="订单号:">
				<span>{{orderInfo.orderNum}}</span>
			</Form-item>
			<Form-item label="日期:">
				<span>{{orderInfo.createTime | timeForm }}</span>
			</Form-item>
			<Form-item label="买家:">
				<span>{{orderInfo.buyersTel}}</span>
			</Form-item>
			<Form-item label="卖家:">
				<span>{{orderInfo.sellerTel}}</span>
			</Form-item>
			<Form-item label="收货地址:">
				<span>{{orderInfo.address}}</span>
			</Form-item>
			<Form-item label="买家备注:">
				<span>{{orderInfo.buyersNote}}</span>
			</Form-item>
			<Form-item>
				<div class="serve-img-box" v-if="orderInfo.car">
					<img :src="orderInfo.car.carPhoto"/>
					<div class="_carName">
						{{orderInfo.car.carName}}
					</div>
					<div class="_carMoney">
						{{orderInfo.car.carMoney}}万元
					</div>
			    </div>
			</Form-item>
			<Form-item label="支付凭证:" v-if="orderInfo.payPhoto">
				<div class="serve-img-box">
					<img :src="orderInfo.payPhoto"  preview="0"/>
				</div>
			</Form-item>
			<div v-if="orderInfo.orderType==5 || orderInfo.orderType==6 || orderInfo.orderType==7 || orderInfo.orderType==8 || orderInfo.orderType==9">
				<Form-item label="发货日期:">
					<span>{{orderInfo.deliveryDate}}</span>
				</Form-item>
				<Form-item label="物流公司:">
					<span>{{orderInfo.logisticsCompany}}</span>
				</Form-item>
				<Form-item label="物流单号:">
					<span>{{orderInfo.logisticsOrder}}</span>
				</Form-item>
				<Form-item label="发货人:">
					<span>{{orderInfo.consignor}}</span>
				</Form-item>
				<Form-item label="手机:">
					<span>{{orderInfo.tel}}</span>
				</Form-item>
				<Form-item label="卖家备注:" class="_border">
					<span>{{orderInfo.sellerNote}}</span>
				</Form-item>
			</div>
			<div  v-if="orderInfo.orderType==6">
				<Form-item label="收货日期:">
					<span>{{orderInfo.confirmTime | timeForm}}</span>
				</Form-item>
			</div>
		</Form>
		<div slot="footer">
			<Button @click="cancel">返回</Button>
			
		</div>
	</Modal>
</template>

<script>
import {formatDate} from '../utils/time.js'
	export default {
		components: {},
		props: {},
		data() {
			return {
				modal: false,
				orderInfo: {},
				orderId: 0,
				isEdit: false,
				loadingBtn: false
			}
		},
		methods: {
			show(res) {
				this.$nextTick(() => {
					this.modal = true
					this.orderId = res.row.orderId
					this.$http.post('old/order/byId', {
						id: res.row.orderId
					}).then(res => {
						if (res.status == 200) {
							if (res.data.code == 200) {
								this.orderInfo = res.data.data;
							}

						}

					})

				})

			},

			//审核不通过
			cancel() {
				this.modal = false
			},
			modalChange(state) {
				if (state) {

				} else {
					this.$refs.formValidate.resetFields()
				}
			}
		}
	}
</script>

<style scoped>
	.serve-img-box img{
		text-align: center;
	   width: 80px;
	   height: 60px;
	}
	._carName{
		display: inline-block;
		margin: 10px 0 0 10px;
		position: absolute
	}
	._carMoney{
		display: inline-block;
		margin: 10px 0 0 130px;
		position: absolute;
	}
	.ivu-form-item{
		margin-bottom: 1px;
	}
	._border{
		padding-bottom: 10px;
		border-bottom: 1px solid #D7DDE4;
	}
</style>
